package com.code.google.ccengel.android.CardsAlpha.ui;

import com.code.google.ccengel.android.CardsAlpha.ui.R;

import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.AdapterView.OnItemClickListener;

public class TraditionalActivity extends ListActivity {
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		//Get the list of Traditional Games
		String[] TraditionalGames = getResources().getStringArray(R.array.traditional_array);
		
		
		setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item,
				TraditionalGames));

		ListView lv = getListView();
		lv.setTextFilterEnabled(true);
		
		lv.setOnItemClickListener(new OnItemClickListener() {
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				
				setContentView(R.layout.game_start);
				// When clicked, show a toast with the TextView text
				Toast.makeText(getApplicationContext(),
						((TextView) view).getText(), Toast.LENGTH_SHORT).show();
			}
		});
	}

}
